<template>
  <div class="about">
    <van-form @submit="onSubmit">
      <van-field
        v-model="username"
        name="账号"
        label="账号"
        placeholder="账号"
        :rules= rules
       />
      <van-field
        v-model="password"
        type="password"
        name="密码"
        label="密码"
        placeholder="密码"
      />
      <div style="margin: 16px;">
        <van-button round block type="info" native-type="submit">
          提交
        </van-button>
      </div>
    </van-form>
  </div>
</template>
<script>
import { Toast } from 'vant';
export default {
  data() {
    return {
      username: '',
      password: '',
      rules: [{
        required: true,
        message: '请填写用户名',
        trigger: 'onBlur'
      }]
    }
  },
  methods: {
    onSubmit() {
      // if(!this.username) {
      //   Toast('请输入用户名');
      // } else if(!this.password) {
      //   Toast('请输入密码');
      // }
      
    }
  }
}
</script>
